package com.dcy.znoa.common.enums;

/**
 * Created by pengyu on 2017/10/6.
 */
public enum AddStatusCode {
//     0 打卡正常
//     1 有申请（不用打卡）
//            8 地点异常
//     9 未打卡
    AS1(0, "打卡正常"),
    AS2(1, "有申请"),
    AS3(8, "地点异常"),
    AS9(9, "未打卡");

    private Integer code;
    private String msg;

    private AddStatusCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static  String getMsgByCode(Integer code) {
        if(code==null){return null;}
        switch (code.intValue()) {
            case 1:
                return AS1.getMsg();
            case 2:
                return AS2.getMsg();
            case 3:
                return AS3.getMsg();
            case 9:
                return AS9.getMsg();
            default:
                return null;
        }
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static  void main(String args[]){
        System.out.println(getMsgByCode(2));

    }

}

